<?php

/**
 * ContantInformation filter form base class.
 *
 * @package    ecrm
 * @subpackage filter
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseContantInformationFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'image'                  => new sfWidgetFormFilterInput(),
      'email'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'first_name'             => new sfWidgetFormFilterInput(),
      'last_name'              => new sfWidgetFormFilterInput(),
      'middle_name'            => new sfWidgetFormFilterInput(),
      'contact_no'             => new sfWidgetFormFilterInput(),
      'mobile_no'              => new sfWidgetFormFilterInput(),
      'total_registration'     => new sfWidgetFormFilterInput(),
      'birthdate'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'designation'            => new sfWidgetFormFilterInput(),
      'address'                => new sfWidgetFormFilterInput(),
      'civil_status'           => new sfWidgetFormFilterInput(),
      'citizenship'            => new sfWidgetFormFilterInput(),
      'employment_status'      => new sfWidgetFormFilterInput(),
      'registration_date'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'last_registration_date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'title'                  => new sfWidgetFormFilterInput(),
      'client_id'              => new sfWidgetFormFilterInput(),
      'kids'                   => new sfWidgetFormFilterInput(),
      'contact_source'         => new sfWidgetFormFilterInput(),
      'ghp_subscriber'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'mds_subscriber'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'created_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'image'                  => new sfValidatorPass(array('required' => false)),
      'email'                  => new sfValidatorPass(array('required' => false)),
      'first_name'             => new sfValidatorPass(array('required' => false)),
      'last_name'              => new sfValidatorPass(array('required' => false)),
      'middle_name'            => new sfValidatorPass(array('required' => false)),
      'contact_no'             => new sfValidatorPass(array('required' => false)),
      'mobile_no'              => new sfValidatorPass(array('required' => false)),
      'total_registration'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'birthdate'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'designation'            => new sfValidatorPass(array('required' => false)),
      'address'                => new sfValidatorPass(array('required' => false)),
      'civil_status'           => new sfValidatorPass(array('required' => false)),
      'citizenship'            => new sfValidatorPass(array('required' => false)),
      'employment_status'      => new sfValidatorPass(array('required' => false)),
      'registration_date'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'last_registration_date' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'title'                  => new sfValidatorPass(array('required' => false)),
      'client_id'              => new sfValidatorPass(array('required' => false)),
      'kids'                   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'contact_source'         => new sfValidatorPass(array('required' => false)),
      'ghp_subscriber'         => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'mds_subscriber'         => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'created_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('contant_information_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ContantInformation';
  }

  public function getFields()
  {
    return array(
      'id'                     => 'Number',
      'image'                  => 'Text',
      'email'                  => 'Text',
      'first_name'             => 'Text',
      'last_name'              => 'Text',
      'middle_name'            => 'Text',
      'contact_no'             => 'Text',
      'mobile_no'              => 'Text',
      'total_registration'     => 'Number',
      'birthdate'              => 'Date',
      'designation'            => 'Text',
      'address'                => 'Text',
      'civil_status'           => 'Text',
      'citizenship'            => 'Text',
      'employment_status'      => 'Text',
      'registration_date'      => 'Date',
      'last_registration_date' => 'Date',
      'title'                  => 'Text',
      'client_id'              => 'Text',
      'kids'                   => 'Number',
      'contact_source'         => 'Text',
      'ghp_subscriber'         => 'Enum',
      'mds_subscriber'         => 'Enum',
      'created_at'             => 'Date',
      'updated_at'             => 'Date',
    );
  }
}
